var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import React from "react";
import { MultipleTapHoc as GridMultipleTapHoc } from "../DevGrid/MultipleHoc";
import DevGridDefaultHoc from "../DevGrid/DefaultHoc";
/**
 ctrl + shift 选择方式
 * @param WrappedComponent
 * @constructor
 */
export default function DevTreeListDefaultapHoc(WrappedComponent) {
    // 泛型限定
    let MultipleTap = class MultipleTap extends WrappedComponent {
        parent = super.render();
        ContextMenu(e) {
            let propsMenus = [];
            if (super.ContextMenu)
                propsMenus = super.ContextMenu(e);
            const defaultMenu = [
                {
                    text: "折叠",
                    items: [
                        {
                            text: "全部展开",
                            onItemClick: () => {
                                const length = this.state.dataSource.length;
                                for (let index = 1; index < length; index++) {
                                    this.getGridInstance().expandRow(index);
                                }
                            },
                        },
                        {
                            text: "全部折叠",
                            onItemClick: () => {
                                const length = this.state.dataSource.length;
                                for (let index = 1; index < length; index++) {
                                    this.getGridInstance().collapseRow(index);
                                }
                            },
                        },
                    ],
                },
            ];
            // console.log([...propsMenus, ...defaultMenu], "listtree111");
            // return [...propsMenus, ...defaultMenu];
            //731临时隐藏
            return [...propsMenus];
        }
        render() {
            const props = {
                ...this.props,
                selection: {
                    mode: "single",
                },
            };
            return React.cloneElement(this.parent, { ...props });
        }
    };
    MultipleTap = __decorate([
        GridMultipleTapHoc,
        DevGridDefaultHoc
    ], MultipleTap);
    return MultipleTap;
}
